package com.ruoyi.dynamic.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dynamic.mapper.RoomProgramRecordMapper;
import com.ruoyi.dynamic.model.pojo.entity.RoomProgramRecord;
import com.ruoyi.dynamic.service.IRoomProgramRecordService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 房间节目单想看记录 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2024-12-03
 */
@Service
public class RoomProgramRecordServiceImpl extends ServiceImpl<RoomProgramRecordMapper, RoomProgramRecord> implements IRoomProgramRecordService {

    @Override
    public Long countHeat(Long id) {
        return lambdaQuery().eq(RoomProgramRecord::getRoomProgramId, id).count();
    }

    @Override
    public boolean countHeat(Long id, Long userId) {
        return lambdaQuery().eq(RoomProgramRecord::getRoomProgramId, id).eq(RoomProgramRecord::getUserId, userId).count() > 0;
    }
}
